$(function(){	
	 $("#form").validation({reqmark:false,icon:true});
	 Wind.use("artDialog", "iframeTools", function () {
	     var api = art.dialog.open.api;      // art.dialog.open扩展方法
	     var origin = art.dialog.open.origin;
	     if (!api)
	         return;
	     	api.button({
	         name: '保存',
	         callback: function () {
	        	if($("#form").valid()){
	        		url = rootPath+'/system/userInfo/editEntity.shtml';
	        		var data_ =$("#form").serializeJson()
	        		if($("#leaderShowId").val()==''){
	        			data_["sysUserFormMap.leader_Id"] = "";
	        		}
	        		$.ajax({
		 				type : 'POST',
		 				async : false,
		 				data : data_,
		 				url :  url,
		 				dataType : 'json',
		 				success : function(data) {
		 					art.dialog.alert('保存成功',function(){
		 						origin.loadData();
		 						api.close();
		 					});
		 				},
		 				error : function(msg) {
		 					art.dialog.alert("保存失败");
		 				}
		 			});
	        	}
	         	return false;
	         },
	         focus: true
	     }, {
	         name: '关闭'
	     });
	 });
	
})




